/*
 *    Copyright (c) 2018-2025, proj All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the proj developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: proj
 */

package com.ykht.proj.coupon.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ykht.proj.common.core.util.R;
import com.ykht.proj.coupon.entity.*;
import com.ykht.proj.coupon.vo.ConfRewardShopVo;
import com.ykht.proj.coupon.vo.FxConfRewardVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import java.util.List;

/**
 * 品牌邀请、转发、核销配置表
 *
 * @author proj code generator
 * @date 2021-02-01 19:00:18
 */
@Mapper
public interface FxConfRewardMapper extends BaseMapper<FxConfReward> {

    IPage<FxConfRewardVO> queryByPage(IPage<FxConfRewardVO> iPage,@Param("fxConfRewardVO") FxConfRewardVO fxConfRewardVO);

	List<FxConfRewardVO> findById(@Param("shopId") Long shopId);

	IPage<FxConfRewardVO> findListById(IPage<FxConfRewardVO> iPage,Integer[] rewardId,FxConfRewardVO fxConfRewardVO);

	Integer[] queryRewardIdByShopId(Long shopId);

	Long queryValueByRuletype(Integer ruleType);

    void updateDelflagById(Long id);

	Long insertValue(FxConfReward confReward);

	void updateDelflagByShopId(Long shopId);

	Object findShopAndBrand(Long shopId);

	List<FxConfRewardVO> findConfReward(@Param("p1") FxConfRewardVO fxConfRewardVO,@Param("p2") CnBrand cnBrand);

	void updateByVo(FxConfRewardVO fxConfRewardVo);

	void delById(Long id);

    ConfRewardShopVo getConfRewardShopVo(@Param("req") ConfRewardShopVo req);

    FxConfRewardVO findConfByBrandIdAndShopId(@Param("p1") FxWaiterExt userExt, @Param("p2") Integer fenXiaoType);

	List<Long> queryAllShopByBrandId(@Param("data") CnBrand data);

	List<Long> queryAllShopByDelflag(@Param("p1") CnBrand data,@Param("p2") FxConfRewardVO fxConfRewardVO);

	List<CnShop> queryShopByIdList(List<Long> cnShops);

	List<CnShop> updateShowHave(@Param("p1") CnBrand cnBrand,@Param("p2") String[] arr);

	List<FxConfShop> judgeConfIsOk(@Param("p1") CnBrand data,@Param("p2") String[] arr,@Param("fxConfRewardVO") FxConfRewardVO fxConfRewardVO);

	void updateStatus();

	List<FxConfShop> judgeConf2IsOk(@Param("p1") CnBrand data,@Param("p2") String[] arr,@Param("fxConfRewardVO") FxConfRewardVO fxConfRewardVO);

    void updateAllConfShop(@Param("id") Long id);
}
